home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / Universal / Interfaces / AIncludes / QD3D.a < prev    next >
Encoding:
Text File  |  1998-08-17  |  37.4 KB  |  1,203 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        QD3D.a
  3. ;
  4. ;    Contains:    Base types for Quickdraw 3D                            
  5. ;
  6. ;    Version:    Technology:    Quickdraw 3D 1.5.4
  7. ;                Release:    Universal Interfaces 3.2
  8. ;
  9. ;    Copyright:    © 1995-1998 by Apple Computer, Inc., all rights reserved.
  10. ;
  11. ;    Bugs?:        For bug reports, consult the following page on
  12. ;                the World Wide Web:
  13. ;
  14. ;                    http://developer.apple.com/bugreporter/
  15. ;
  16. ;
  17.     IF &TYPE('__QD3D__') = 'UNDEFINED' THEN
  18. __QD3D__ SET 1
  19.  
  20.     IF &TYPE('__CONDITIONALMACROS__') = 'UNDEFINED' THEN
  21.     include 'ConditionalMacros.a'
  22.     ENDIF
  23.  
  24.     IF TARGET_OS_MAC THEN
  25.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  26.     include 'MacTypes.a'
  27.     ENDIF
  28.     ENDIF    ; TARGET_OS_MAC
  29.     IF TARGET_OS_MAC THEN
  30.     OS_MACINTOSH: SET 1
  31.     OS_WIN32: SET 0
  32.     OS_UNIX: SET 0
  33.     OS_NEXT: SET 0
  34.     WINDOW_SYSTEM_MACINTOSH: SET 1
  35.     WINDOW_SYSTEM_WIN32: SET 0
  36.     WINDOW_SYSTEM_X11: SET 0
  37.     WINDOW_SYSTEM_NEXT: SET 0
  38.     ENDIF    ; TARGET_OS_MAC
  39.  
  40. ; ******************************************************************************
  41. ; **                                                                             **
  42. ; **                                NULL definition                                 **
  43. ; **                                                                             **
  44. ; ****************************************************************************
  45.  
  46. ; ******************************************************************************
  47. ; **                                                                             **
  48. ; **                                    Objects                                     **
  49. ; **                                                                             **
  50. ; ****************************************************************************
  51.  
  52. ; * Everything in QuickDraw 3D is an OBJECT: a bunch of data with a type,
  53. ; * deletion, duplication, and i/o methods.
  54.  
  55. ; typedef long                             TQ3ObjectType
  56.  
  57.  
  58.  
  59. ;  
  60. ; * There are four subclasses of OBJECT:
  61. ; *    an ELEMENT, which is data that is placed in a SET
  62. ; *    a SHAREDOBJECT, which is reference-counted data that is shared
  63. ; *    VIEWs, which maintain state information for an image
  64. ; *    a PICK, which used to query a VIEW
  65.  
  66. ; typedef TQ3Object                     TQ3ElementObject
  67.  
  68. ; typedef TQ3Object                     TQ3SharedObject
  69.  
  70. ; typedef TQ3Object                     TQ3ViewObject
  71.  
  72. ; typedef TQ3Object                     TQ3PickObject
  73.  
  74. ; * There are several types of SharedObjects:
  75. ; *    RENDERERs, which paint to a drawContext
  76. ; *    DRAWCONTEXTs, which are an interface to a device 
  77. ; *    SETs, which maintains "mathematical sets" of ELEMENTs
  78. ; *    FILEs, which maintain state information for a metafile
  79. ; *    SHAPEs, which affect the state of the View
  80. ; *    SHAPEPARTs, which contain geometry-specific data about a picking hit
  81. ; *    CONTROLLERSTATEs, which hold state of the output channels for a CONTROLLER
  82. ; *    TRACKERs, which represent a position and orientation in the user interface
  83. ; *  STRINGs, which are abstractions of text string data.
  84. ; *    STORAGE, which is an abstraction for stream-based data storage (files, memory)
  85. ; *    TEXTUREs, for sharing bitmap information for TEXTURESHADERS
  86. ; *    VIEWHINTs, which specifies viewing preferences in FILEs
  87.  
  88. ; typedef TQ3SharedObject                 TQ3RendererObject
  89.  
  90. ; typedef TQ3SharedObject                 TQ3DrawContextObject
  91.  
  92. ; typedef TQ3SharedObject                 TQ3SetObject
  93.  
  94. ; typedef TQ3SharedObject                 TQ3FileObject
  95.  
  96. ; typedef TQ3SharedObject                 TQ3ShapeObject
  97.  
  98. ; typedef TQ3SharedObject                 TQ3ShapePartObject
  99.  
  100. ; typedef TQ3SharedObject                 TQ3ControllerStateObject
  101.  
  102. ; typedef TQ3SharedObject                 TQ3TrackerObject
  103.  
  104. ; typedef TQ3SharedObject                 TQ3StringObject
  105.  
  106. ; typedef TQ3SharedObject                 TQ3StorageObject
  107.  
  108. ; typedef TQ3SharedObject                 TQ3TextureObject
  109.  
  110. ; typedef TQ3SharedObject                 TQ3ViewHintsObject
  111.  
  112. ; * There is one types of SET:
  113. ; *    ATTRIBUTESETs, which contain ATTRIBUTEs which are inherited 
  114.  
  115. ; typedef TQ3SetObject                     TQ3AttributeSet
  116.  
  117. ; * There are many types of SHAPEs:
  118. ; *    LIGHTs, which affect how the RENDERER draws 3-D cues
  119. ; *    CAMERAs, which affects the location and orientation of the RENDERER in space
  120. ; *    GROUPs, which may contain any number of SHARED OBJECTS
  121. ; *    GEOMETRYs, which are representations of three-dimensional data
  122. ; *    SHADERs, which affect how colors are drawn on a geometry
  123. ; *    STYLEs, which affect how the RENDERER paints to the DRAWCONTEXT
  124. ; *    TRANSFORMs, which affect the coordinate system in the VIEW
  125. ; *    REFERENCEs, which are references to objects in FILEs
  126. ; *  UNKNOWN, which hold unknown objects read from a metafile.
  127.  
  128. ; typedef TQ3ShapeObject                 TQ3GroupObject
  129.  
  130. ; typedef TQ3ShapeObject                 TQ3GeometryObject
  131.  
  132. ; typedef TQ3ShapeObject                 TQ3ShaderObject
  133.  
  134. ; typedef TQ3ShapeObject                 TQ3StyleObject
  135.  
  136. ; typedef TQ3ShapeObject                 TQ3TransformObject
  137.  
  138. ; typedef TQ3ShapeObject                 TQ3LightObject
  139.  
  140. ; typedef TQ3ShapeObject                 TQ3CameraObject
  141.  
  142. ; typedef TQ3ShapeObject                 TQ3UnknownObject
  143.  
  144. ; typedef TQ3ShapeObject                 TQ3ReferenceObject
  145.  
  146. ; * For now, there is only one type of SHAPEPARTs:
  147. ; *    MESHPARTs, which describe some part of a mesh
  148.  
  149. ; typedef TQ3ShapePartObject             TQ3MeshPartObject
  150.  
  151. ; * There are three types of MESHPARTs:
  152. ; *    MESHFACEPARTs, which describe a face of a mesh
  153. ; *    MESHEDGEPARTs, which describe a edge of a mesh
  154. ; *    MESHVERTEXPARTs, which describe a vertex of a mesh
  155.  
  156. ; typedef TQ3MeshPartObject             TQ3MeshFacePartObject
  157.  
  158. ; typedef TQ3MeshPartObject             TQ3MeshEdgePartObject
  159.  
  160. ; typedef TQ3MeshPartObject             TQ3MeshVertexPartObject
  161.  
  162. ; * A DISPLAY Group can be drawn to a view
  163.  
  164. ; typedef TQ3GroupObject                 TQ3DisplayGroupObject
  165.  
  166. ; * There are many types of SHADERs:
  167. ; *    SURFACESHADERs, which affect how the surface of a geometry is painted
  168. ; *    ILLUMINATIONSHADERs, which affect how lights affect the color of a surface
  169.  
  170. ; typedef TQ3ShaderObject                 TQ3SurfaceShaderObject
  171.  
  172. ; typedef TQ3ShaderObject                 TQ3IlluminationShaderObject
  173.  
  174. ; * A handle to an object in a group
  175.  
  176.  
  177.  
  178. ;  
  179. ; * TQ3ObjectClassNameString is used for the class name of an object
  180.  
  181.  
  182. kQ3StringMaximumLength            EQU        1024
  183. TQ3ObjectClassNameString RECORD 0
  184. elements                 ds.b    1024
  185. sizeof                     EQU *                    ; size:   $400 (1024)
  186.                         ENDR
  187.  
  188.  
  189. ; ******************************************************************************
  190. ; **                                                                             **
  191. ; **                            Client/Server Things                             **
  192. ; **                                                                             **
  193. ; ****************************************************************************
  194.  
  195. ; typedef void *                        TQ3ControllerRef
  196.  
  197. ; ******************************************************************************
  198. ; **                                                                             **
  199. ; **                            Flags and Switches                                 **
  200. ; **                                                                             **
  201. ; ****************************************************************************
  202.  
  203.  
  204. ; typedef long                            TQ3Boolean
  205. kQ3False                        EQU        0
  206. kQ3True                            EQU        1
  207.  
  208. ; typedef long                            TQ3Switch
  209. kQ3Off                            EQU        0
  210. kQ3On                            EQU        1
  211.  
  212. ; typedef long                            TQ3Status
  213. kQ3Failure                        EQU        0
  214. kQ3Success                        EQU        1
  215.  
  216. ; typedef long                            TQ3Axis
  217. kQ3AxisX                        EQU        0
  218. kQ3AxisY                        EQU        1
  219. kQ3AxisZ                        EQU        2
  220.  
  221. ; typedef long                            TQ3PixelType
  222. kQ3PixelTypeRGB32                EQU        0                    ; Alpha:8 (ignored), R:8, G:8, B:8    
  223. kQ3PixelTypeARGB32                EQU        1                    ; Alpha:8, R:8, G:8, B:8             
  224. kQ3PixelTypeRGB16                EQU        2                    ; Alpha:1 (ignored), R:5, G:5, B:5    
  225. kQ3PixelTypeARGB16                EQU        3                    ; Alpha:1, R:5, G:5, B:5             
  226. kQ3PixelTypeRGB16_565            EQU        4                    ; Win32 only: 16 bits/pixel, R:5, G:6, B:5        
  227. kQ3PixelTypeRGB24                EQU        5                    ; Win32 only: 24 bits/pixel, R:8, G:8, B:8        
  228.  
  229. ; typedef long                            TQ3Endian
  230. kQ3EndianBig                    EQU        0
  231. kQ3EndianLittle                    EQU        1
  232.  
  233. ; typedef long                            TQ3EndCapMasks
  234. kQ3EndCapNone                    EQU        0
  235. kQ3EndCapMaskTop                EQU        $01
  236. kQ3EndCapMaskBottom                EQU        $02
  237. kQ3EndCapMaskInterior            EQU        $04
  238. ; typedef unsigned long                 TQ3EndCap
  239.  
  240.  
  241. kQ3ArrayIndexNULL                EQU        -1
  242. ; ******************************************************************************
  243. ; **                                                                             **
  244. ; **                        Point and Vector Definitions                         **
  245. ; **                                                                             **
  246. ; ****************************************************************************
  247.  
  248. TQ3Vector2D                RECORD 0
  249. x                         ds        Float32            ; offset: $0 (0)
  250. y                         ds        Float32            ; offset: $4 (4)
  251. sizeof                     EQU *                    ; size:   $8 (8)
  252.                         ENDR
  253. TQ3Vector3D                RECORD 0
  254. x                         ds        Float32            ; offset: $0 (0)
  255. y                         ds        Float32            ; offset: $4 (4)
  256. z                         ds        Float32            ; offset: $8 (8)
  257. sizeof                     EQU *                    ; size:   $C (12)
  258.                         ENDR
  259. TQ3Point2D                RECORD 0
  260. x                         ds        Float32            ; offset: $0 (0)
  261. y                         ds        Float32            ; offset: $4 (4)
  262. sizeof                     EQU *                    ; size:   $8 (8)
  263.                         ENDR
  264. TQ3Point3D                RECORD 0
  265. x                         ds        Float32            ; offset: $0 (0)
  266. y                         ds        Float32            ; offset: $4 (4)
  267. z                         ds        Float32            ; offset: $8 (8)
  268. sizeof                     EQU *                    ; size:   $C (12)
  269.                         ENDR
  270. TQ3RationalPoint4D        RECORD 0
  271. x                         ds        Float32            ; offset: $0 (0)
  272. y                         ds        Float32            ; offset: $4 (4)
  273. z                         ds        Float32            ; offset: $8 (8)
  274. w                         ds        Float32            ; offset: $C (12)
  275. sizeof                     EQU *                    ; size:   $10 (16)
  276.                         ENDR
  277. TQ3RationalPoint3D        RECORD 0
  278. x                         ds        Float32            ; offset: $0 (0)
  279. y                         ds        Float32            ; offset: $4 (4)
  280. w                         ds        Float32            ; offset: $8 (8)
  281. sizeof                     EQU *                    ; size:   $C (12)
  282.                         ENDR
  283. ; ******************************************************************************
  284. ; **                                                                             **
  285. ; **                                Quaternion                                     **
  286. ; **                                                                             **
  287. ; ****************************************************************************
  288.  
  289. TQ3Quaternion            RECORD 0
  290. w                         ds        Float32            ; offset: $0 (0)
  291. x                         ds        Float32            ; offset: $4 (4)
  292. y                         ds        Float32            ; offset: $8 (8)
  293. z                         ds        Float32            ; offset: $C (12)
  294. sizeof                     EQU *                    ; size:   $10 (16)
  295.                         ENDR
  296. ; ******************************************************************************
  297. ; **                                                                             **
  298. ; **                                Ray Definition                                 **
  299. ; **                                                                             **
  300. ; ****************************************************************************
  301.  
  302. TQ3Ray3D                RECORD 0
  303. origin                     ds        TQ3Point3D        ; offset: $0 (0)
  304. direction                 ds        TQ3Vector3D        ; offset: $C (12)
  305. sizeof                     EQU *                    ; size:   $18 (24)
  306.                         ENDR
  307. ; ******************************************************************************
  308. ; **                                                                             **
  309. ; **                        Parameterization Data Structures                     **
  310. ; **                                                                             **
  311. ; ****************************************************************************
  312.  
  313. TQ3Param2D                RECORD 0
  314. u                         ds        Float32            ; offset: $0 (0)
  315. v                         ds        Float32            ; offset: $4 (4)
  316. sizeof                     EQU *                    ; size:   $8 (8)
  317.                         ENDR
  318. TQ3Param3D                RECORD 0
  319. u                         ds        Float32            ; offset: $0 (0)
  320. v                         ds        Float32            ; offset: $4 (4)
  321. w                         ds        Float32            ; offset: $8 (8)
  322. sizeof                     EQU *                    ; size:   $C (12)
  323.                         ENDR
  324. TQ3Tangent2D            RECORD 0
  325. uTangent                 ds        TQ3Vector3D        ; offset: $0 (0)
  326. vTangent                 ds        TQ3Vector3D        ; offset: $C (12)
  327. sizeof                     EQU *                    ; size:   $18 (24)
  328.                         ENDR
  329. TQ3Tangent3D            RECORD 0
  330. uTangent                 ds        TQ3Vector3D        ; offset: $0 (0)
  331. vTangent                 ds        TQ3Vector3D        ; offset: $C (12)
  332. wTangent                 ds        TQ3Vector3D        ; offset: $18 (24)
  333. sizeof                     EQU *                    ; size:   $24 (36)
  334.                         ENDR
  335. ; ******************************************************************************
  336. ; **                                                                             **
  337. ; **                        Polar and Spherical Coordinates                         **
  338. ; **                                                                             **
  339. ; ****************************************************************************
  340.  
  341. TQ3PolarPoint            RECORD 0
  342. r                         ds        Float32            ; offset: $0 (0)
  343. theta                     ds        Float32            ; offset: $4 (4)
  344. sizeof                     EQU *                    ; size:   $8 (8)
  345.                         ENDR
  346. TQ3SphericalPoint        RECORD 0
  347. rho                         ds        Float32            ; offset: $0 (0)
  348. theta                     ds        Float32            ; offset: $4 (4)
  349. phi                         ds        Float32            ; offset: $8 (8)
  350. sizeof                     EQU *                    ; size:   $C (12)
  351.                         ENDR
  352. ; ******************************************************************************
  353. ; **                                                                             **
  354. ; **                            Color Definition                                 **
  355. ; **                                                                             **
  356. ; ****************************************************************************
  357.  
  358. TQ3ColorRGB                RECORD 0
  359. r                         ds        Float32            ; offset: $0 (0)
  360. g                         ds        Float32            ; offset: $4 (4)
  361. b                         ds        Float32            ; offset: $8 (8)
  362. sizeof                     EQU *                    ; size:   $C (12)
  363.                         ENDR
  364. TQ3ColorARGB            RECORD 0
  365. a                         ds        Float32            ; offset: $0 (0)
  366. r                         ds        Float32            ; offset: $4 (4)
  367. g                         ds        Float32            ; offset: $8 (8)
  368. b                         ds        Float32            ; offset: $C (12)
  369. sizeof                     EQU *                    ; size:   $10 (16)
  370.                         ENDR
  371. ; ******************************************************************************
  372. ; **                                                                             **
  373. ; **                                    Vertices                                 **
  374. ; **                                                                             **
  375. ; ****************************************************************************
  376.  
  377. TQ3Vertex3D                RECORD 0
  378. point                     ds        TQ3Point3D        ; offset: $0 (0)
  379. attributeSet             ds.l    1                ; offset: $C (12)
  380. sizeof                     EQU *                    ; size:   $10 (16)
  381.                         ENDR
  382. ; ******************************************************************************
  383. ; **                                                                             **
  384. ; **                                    Matrices                                 **
  385. ; **                                                                             **
  386. ; ****************************************************************************
  387.  
  388. TQ3Matrix3x3            RECORD 0
  389. value                     ds.b    3 * 3 * Float32.sizeof ; offset: $0 (0)
  390. sizeof                     EQU *                    ; size:   $24 (36)
  391.                         ENDR
  392. TQ3Matrix4x4            RECORD 0
  393. value                     ds.b    4 * 4 * Float32.sizeof ; offset: $0 (0)
  394. sizeof                     EQU *                    ; size:   $40 (64)
  395.                         ENDR
  396. ; ******************************************************************************
  397. ; **                                                                             **
  398. ; **                                Bitmap/Pixmap                                 **
  399. ; **                                                                             **
  400. ; ****************************************************************************
  401.  
  402. TQ3Pixmap                RECORD 0
  403. image                     ds.l    1                ; offset: $0 (0)
  404. width                     ds.l    1                ; offset: $4 (4)
  405. height                     ds.l    1                ; offset: $8 (8)
  406. rowBytes                 ds.l    1                ; offset: $C (12)
  407. pixelSize                 ds.l    1                ; offset: $10 (16)        ;  MUST be 16 or 32 to use with the    Interactive Renderer on Mac OS
  408. pixelType                 ds.l    1                ; offset: $14 (20)
  409. bitOrder                 ds.l    1                ; offset: $18 (24)
  410. byteOrder                 ds.l    1                ; offset: $1C (28)
  411. sizeof                     EQU *                    ; size:   $20 (32)
  412.                         ENDR
  413. TQ3StoragePixmap        RECORD 0
  414. image                     ds.l    1                ; offset: $0 (0)
  415. width                     ds.l    1                ; offset: $4 (4)
  416. height                     ds.l    1                ; offset: $8 (8)
  417. rowBytes                 ds.l    1                ; offset: $C (12)
  418. pixelSize                 ds.l    1                ; offset: $10 (16)        ;  MUST be 16 or 32 to use with the    Interactive Renderer on Mac OS
  419. pixelType                 ds.l    1                ; offset: $14 (20)
  420. bitOrder                 ds.l    1                ; offset: $18 (24)
  421. byteOrder                 ds.l    1                ; offset: $1C (28)
  422. sizeof                     EQU *                    ; size:   $20 (32)
  423.                         ENDR
  424. TQ3Bitmap                RECORD 0
  425. image                     ds.l    1                ; offset: $0 (0)
  426. width                     ds.l    1                ; offset: $4 (4)
  427. height                     ds.l    1                ; offset: $8 (8)
  428. rowBytes                 ds.l    1                ; offset: $C (12)
  429. bitOrder                 ds.l    1                ; offset: $10 (16)
  430. sizeof                     EQU *                    ; size:   $14 (20)
  431.                         ENDR
  432. TQ3MipmapImage            RECORD 0
  433. ;  An image for use as a texture mipmap  
  434. width                     ds.l    1                ; offset: $0 (0)        ;  Width of mipmap, must be power of 2   
  435. height                     ds.l    1                ; offset: $4 (4)        ;  Height of mipmap, must be power of 2  
  436. rowBytes                 ds.l    1                ; offset: $8 (8)        ;  Rowbytes of mipmap                    
  437. offset                     ds.l    1                ; offset: $C (12)        ;  Offset from image base to this mipmap 
  438. sizeof                     EQU *                    ; size:   $10 (16)
  439.                         ENDR
  440. TQ3Mipmap                RECORD 0
  441. image                     ds.l    1                ; offset: $0 (0)        ;  Data containing the texture map and      
  442. ;  if (useMipmapping==kQ3True) the          
  443. ;  mipmap data                              
  444. useMipmapping             ds.l    1                ; offset: $4 (4)        ;  True if mipmapping should be used      
  445. ;  and all mipmaps have been provided    
  446. pixelType                 ds.l    1                ; offset: $8 (8)
  447. bitOrder                 ds.l    1                ; offset: $C (12)
  448. byteOrder                 ds.l    1                ; offset: $10 (16)
  449. reserved                 ds.l    1                ; offset: $14 (20)        ;  leave NULL for next version             
  450. mipmaps                     ds.b    32 * TQ3MipmapImage.sizeof ; offset: $18 (24) ;  The actual number of mipmaps is determined from the size of the first mipmap 
  451. sizeof                     EQU *                    ; size:   $218 (536)
  452.                         ENDR
  453.  
  454. ; ******************************************************************************
  455. ; **                                                                             **
  456. ; **                        Higher dimension quantities                             **
  457. ; **                                                                             **
  458. ; ****************************************************************************
  459.  
  460. TQ3Area                    RECORD 0
  461. min                         ds        TQ3Point2D        ; offset: $0 (0)
  462. max                         ds        TQ3Point2D        ; offset: $8 (8)
  463. sizeof                     EQU *                    ; size:   $10 (16)
  464.                         ENDR
  465. TQ3PlaneEquation        RECORD 0
  466. normal                     ds        TQ3Vector3D        ; offset: $0 (0)
  467. constant                 ds        Float32            ; offset: $C (12)
  468. sizeof                     EQU *                    ; size:   $10 (16)
  469.                         ENDR
  470. TQ3BoundingBox            RECORD 0
  471. min                         ds        TQ3Point3D        ; offset: $0 (0)
  472. max                         ds        TQ3Point3D        ; offset: $C (12)
  473. isEmpty                     ds.l    1                ; offset: $18 (24)
  474. sizeof                     EQU *                    ; size:   $1C (28)
  475.                         ENDR
  476. TQ3BoundingSphere        RECORD 0
  477. origin                     ds        TQ3Point3D        ; offset: $0 (0)
  478. radius                     ds        Float32            ; offset: $C (12)
  479. isEmpty                     ds.l    1                ; offset: $10 (16)
  480. sizeof                     EQU *                    ; size:   $14 (20)
  481.                         ENDR
  482. ; *    The TQ3ComputeBounds flag passed to StartBoundingBox or StartBoundingSphere
  483. ; *    calls in the View. It's a hint to the system as to how it should 
  484. ; *    compute the bbox of a shape:
  485. ; *
  486. ; *    kQ3ComputeBoundsExact:    
  487. ; *        Vertices of shapes are transformed into world space and
  488. ; *        the world space bounding box is computed from them.  Slow!
  489. ; *    
  490. ; *    kQ3ComputeBoundsApproximate: 
  491. ; *        A local space bounding box is computed from a shape's
  492. ; *        vertices.  This bbox is then transformed into world space,
  493. ; *        and its bounding box is taken as the shape's approximate
  494. ; *        bbox.  Fast but the bbox is larger than optimal.
  495.  
  496.  
  497. ; typedef long                            TQ3ComputeBounds
  498. kQ3ComputeBoundsExact            EQU        0
  499. kQ3ComputeBoundsApproximate        EQU        1
  500.  
  501. ; ******************************************************************************
  502. ; **                                                                             **
  503. ; **                            Object System Types                                 **
  504. ; **                                                                             **
  505. ; ****************************************************************************
  506.  
  507.  
  508.  
  509.  
  510. ; typedef unsigned long                 TQ3XMethodType
  511.  
  512. ; * Object methods
  513.  
  514. ;  
  515. ; *  Return true from the metahandler if this 
  516. ; *  object can be submitted in a rendering loop 
  517.  
  518. ; * MetaHandler:
  519. ; *        When you give a metahandler to QuickDraw 3D, it is called multiple 
  520. ; *        times to build method tables, and then is thrown away. You are 
  521. ; *        guaranteed that your metahandler will never be called again after a 
  522. ; *        call that was passed a metahandler returns.
  523. ; *
  524. ; *        Your metahandler should contain a switch on the methodType passed to it
  525. ; *        and should return the corresponding method as an TQ3XFunctionPointer.
  526. ; *
  527. ; *        IMPORTANT: A metaHandler MUST always "return" a value. If you are
  528. ; *        passed a methodType that you do not understand, ALWAYS return NULL.
  529. ; *
  530. ; *        These types here are prototypes of how your functions should look.
  531.  
  532. ; * See QD3DIO.h for the IO method types: 
  533. ; *        ObjectReadData, ObjectTraverse, ObjectWrite
  534.  
  535.  
  536. ; ******************************************************************************
  537. ; **                                                                             **
  538. ; **                                Set Types                                     **
  539. ; **                                                                             **
  540. ; ****************************************************************************
  541.  
  542. ; typedef long                             TQ3ElementType
  543.  
  544.  
  545. kQ3ElementTypeNone                EQU        0
  546. kQ3ElementTypeUnknown            EQU        32
  547. kQ3ElementTypeSet                EQU        33
  548.  
  549. ;  
  550. ; *    kQ3ElementTypeUnknown is a TQ3Object. 
  551. ; *    
  552. ; *        Do Q3Set_Add(s, ..., &obj) or Q3Set_Get(s, ..., &obj);
  553. ; *        
  554. ; *        Note that the object is always referenced when copying around. 
  555. ; *        
  556. ; *        Generally, it is an Unknown object, a Group of Unknown objects, or a 
  557. ; *        group of other "objects" which have been found in the metafile and
  558. ; *        have no attachment method to their parent. Be prepared to handle
  559. ; *        any or all of these cases if you actually access the set on a shape.
  560. ; *
  561. ; *    kQ3ElementTypeSet is a TQ3SetObject. 
  562. ; *    
  563. ; *        Q3Shape_GetSet(s,&o) is eqivalent to 
  564. ; *            Q3Shape_GetElement(s, kQ3ElementTypeSet, &o)
  565. ; *            
  566. ; *        Q3Shape_SetSet(s,o)  is eqivalent to 
  567. ; *            Q3Shape_SetElement(s, kQ3ElementTypeSet, &o)
  568. ; *    
  569. ; *        Note that the object is always referenced when copying around. 
  570. ; *        
  571. ; *    See the note below about the Set and Shape changes.
  572.  
  573.  
  574. ; ******************************************************************************
  575. ; **                                                                             **
  576. ; **                            Object System Macros                             **
  577. ; **                                                                             **
  578. ; ****************************************************************************
  579.  
  580. ; ******************************************************************************
  581. ; **                                                                             **
  582. ; **                                Object Types                                 **
  583. ; **                                                                             **
  584. ; ****************************************************************************
  585.  
  586. ; * Note:    a call to Q3Foo_GetType will return a value kQ3FooTypeBar
  587. ; *            e.g. Q3Shared_GetType(object) returns kQ3SharedTypeShape, etc.
  588.  
  589.  
  590.  
  591. kQ3ObjectTypeInvalid            EQU        0
  592. kQ3ObjectTypeView                EQU        'view'
  593. kQ3ObjectTypeElement            EQU        'elmn'
  594. kQ3ElementTypeAttribute            EQU        'eatt'
  595. kQ3ObjectTypePick                EQU        'pick'
  596. kQ3PickTypeWindowPoint            EQU        'pkwp'
  597. kQ3PickTypeWindowRect            EQU        'pkwr'
  598. kQ3ObjectTypeShared                EQU        'shrd'
  599. kQ3SharedTypeRenderer            EQU        'rddr'
  600. kQ3RendererTypeWireFrame        EQU        'wrfr'
  601. kQ3RendererTypeGeneric            EQU        'gnrr'
  602. kQ3RendererTypeInteractive        EQU        'ctwn'
  603. kQ3SharedTypeShape                EQU        'shap'
  604. kQ3ShapeTypeGeometry            EQU        'gmtr'
  605. kQ3GeometryTypeBox                EQU        'box '
  606. kQ3GeometryTypeGeneralPolygon    EQU        'gpgn'
  607. kQ3GeometryTypeLine                EQU        'line'
  608. kQ3GeometryTypeMarker            EQU        'mrkr'
  609. kQ3GeometryTypePixmapMarker        EQU        'mrkp'
  610. kQ3GeometryTypeMesh                EQU        'mesh'
  611. kQ3GeometryTypeNURBCurve        EQU        'nrbc'
  612. kQ3GeometryTypeNURBPatch        EQU        'nrbp'
  613. kQ3GeometryTypePoint            EQU        'pnt '
  614. kQ3GeometryTypePolygon            EQU        'plyg'
  615. kQ3GeometryTypePolyLine            EQU        'plyl'
  616. kQ3GeometryTypeTriangle            EQU        'trng'
  617. kQ3GeometryTypeTriGrid            EQU        'trig'
  618. kQ3GeometryTypeCone                EQU        'cone'
  619. kQ3GeometryTypeCylinder            EQU        'cyln'
  620. kQ3GeometryTypeDisk                EQU        'disk'
  621. kQ3GeometryTypeEllipse            EQU        'elps'
  622. kQ3GeometryTypeEllipsoid        EQU        'elpd'
  623. kQ3GeometryTypePolyhedron        EQU        'plhd'
  624. kQ3GeometryTypeTorus            EQU        'tors'
  625. kQ3GeometryTypeTriMesh            EQU        'tmsh'
  626. kQ3ShapeTypeShader                EQU        'shdr'
  627. kQ3ShaderTypeSurface            EQU        'sush'
  628. kQ3SurfaceShaderTypeTexture        EQU        'txsu'
  629. kQ3ShaderTypeIllumination        EQU        'ilsh'
  630. kQ3IlluminationTypePhong        EQU        'phil'
  631. kQ3IlluminationTypeLambert        EQU        'lmil'
  632. kQ3IlluminationTypeNULL            EQU        'nuil'
  633. kQ3ShapeTypeStyle                EQU        'styl'
  634. kQ3StyleTypeBackfacing            EQU        'bckf'
  635. kQ3StyleTypeInterpolation        EQU        'intp'
  636. kQ3StyleTypeFill                EQU        'fist'
  637. kQ3StyleTypePickID                EQU        'pkid'
  638. kQ3StyleTypeReceiveShadows        EQU        'rcsh'
  639. kQ3StyleTypeHighlight            EQU        'high'
  640. kQ3StyleTypeSubdivision            EQU        'sbdv'
  641. kQ3StyleTypeOrientation            EQU        'ofdr'
  642. kQ3StyleTypePickParts            EQU        'pkpt'
  643. kQ3StyleTypeAntiAlias            EQU        'anti'
  644. kQ3ShapeTypeTransform            EQU        'xfrm'
  645. kQ3TransformTypeMatrix            EQU        'mtrx'
  646. kQ3TransformTypeScale            EQU        'scal'
  647. kQ3TransformTypeTranslate        EQU        'trns'
  648. kQ3TransformTypeRotate            EQU        'rott'
  649. kQ3TransformTypeRotateAboutPoint EQU    'rtap'
  650. kQ3TransformTypeRotateAboutAxis    EQU        'rtaa'
  651. kQ3TransformTypeQuaternion        EQU        'qtrn'
  652. kQ3TransformTypeReset            EQU        'rset'
  653. kQ3ShapeTypeLight                EQU        'lght'
  654. kQ3LightTypeAmbient                EQU        'ambn'
  655. kQ3LightTypeDirectional            EQU        'drct'
  656. kQ3LightTypePoint                EQU        'pntl'
  657. kQ3LightTypeSpot                EQU        'spot'
  658. kQ3ShapeTypeCamera                EQU        'cmra'
  659. kQ3CameraTypeOrthographic        EQU        'orth'
  660. kQ3CameraTypeViewPlane            EQU        'vwpl'
  661. kQ3CameraTypeViewAngleAspect    EQU        'vana'
  662. kQ3ShapeTypeGroup                EQU        'grup'
  663. kQ3GroupTypeDisplay                EQU        'dspg'
  664. kQ3DisplayGroupTypeOrdered        EQU        'ordg'
  665. kQ3DisplayGroupTypeIOProxy        EQU        'iopx'
  666. kQ3GroupTypeLight                EQU        'lghg'
  667. kQ3GroupTypeInfo                EQU        'info'
  668. kQ3ShapeTypeUnknown                EQU        'unkn'
  669. kQ3UnknownTypeText                EQU        'uktx'
  670. kQ3UnknownTypeBinary            EQU        'ukbn'
  671. kQ3ShapeTypeReference            EQU        'rfrn'
  672. kQ3ReferenceTypeExternal        EQU        'rfex'
  673. kQ3SharedTypeSet                EQU        'set '
  674. kQ3SetTypeAttribute                EQU        'attr'
  675. kQ3SharedTypeDrawContext        EQU        'dctx'
  676. kQ3DrawContextTypePixmap        EQU        'dpxp'
  677. kQ3DrawContextTypeMacintosh        EQU        'dmac'
  678. kQ3DrawContextTypeWin32DC        EQU        'dw32'
  679. kQ3DrawContextTypeDDSurface        EQU        'ddds'
  680. kQ3DrawContextTypeX11            EQU        'dx11'
  681. kQ3SharedTypeTexture            EQU        'txtr'
  682. kQ3TextureTypePixmap            EQU        'txpm'
  683. kQ3TextureTypeMipmap            EQU        'txmm'
  684. kQ3SharedTypeFile                EQU        'file'
  685. kQ3SharedTypeStorage            EQU        'strg'
  686. kQ3StorageTypeMemory            EQU        'mems'
  687. kQ3MemoryStorageTypeHandle        EQU        'hndl'
  688. kQ3StorageTypeUnix                EQU        'uxst'
  689. kQ3UnixStorageTypePath            EQU        'unix'
  690. kQ3StorageTypeMacintosh            EQU        'macn'
  691. kQ3MacintoshStorageTypeFSSpec    EQU        'macp'
  692. kQ3StorageTypeWin32                EQU        'wist'
  693. kQ3SharedTypeString                EQU        'strn'
  694. kQ3StringTypeCString            EQU        'strc'
  695. kQ3SharedTypeShapePart            EQU        'sprt'
  696. kQ3ShapePartTypeMeshPart        EQU        'spmh'
  697. kQ3MeshPartTypeMeshFacePart        EQU        'mfac'
  698. kQ3MeshPartTypeMeshEdgePart        EQU        'medg'
  699. kQ3MeshPartTypeMeshVertexPart    EQU        'mvtx'
  700. kQ3SharedTypeControllerState    EQU        'ctst'
  701. kQ3SharedTypeTracker            EQU        'trkr'
  702. kQ3SharedTypeViewHints            EQU        'vwhn'
  703. kQ3SharedTypeEndGroup            EQU        'endg'
  704. ; ******************************************************************************
  705. ; **                                                                             **
  706. ; **                            QuickDraw 3D System Routines                     **
  707. ; **                                                                             **
  708. ; ****************************************************************************
  709.  
  710. ;
  711. ; extern TQ3Status Q3Initialize(void )
  712. ;
  713.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  714.         IMPORT_CFM_FUNCTION Q3Initialize
  715.     ENDIF
  716.  
  717. ;
  718. ; extern TQ3Status Q3Exit(void )
  719. ;
  720.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  721.         IMPORT_CFM_FUNCTION Q3Exit
  722.     ENDIF
  723.  
  724. ;
  725. ; extern TQ3Boolean Q3IsInitialized(void )
  726. ;
  727.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  728.         IMPORT_CFM_FUNCTION Q3IsInitialized
  729.     ENDIF
  730.  
  731. ;
  732. ; extern TQ3Status Q3GetVersion(unsigned long *majorRevision, unsigned long *minorRevision)
  733. ;
  734.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  735.         IMPORT_CFM_FUNCTION Q3GetVersion
  736.     ENDIF
  737.  
  738. ; *  Q3GetReleaseVersion returns the release version number,
  739. ; *  in the format of the first four bytes of a 'vers' resource
  740. ; *  (e.g. 0x01518000 ==> 1.5.1 release).
  741.  
  742. ;
  743. ; extern TQ3Status Q3GetReleaseVersion(unsigned long *releaseRevision)
  744. ;
  745.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  746.         IMPORT_CFM_FUNCTION Q3GetReleaseVersion
  747.     ENDIF
  748.  
  749.  
  750. ; ******************************************************************************
  751. ; **                                                                             **
  752. ; **                            ObjectClass Routines                             **
  753. ; **                                                                             **
  754. ; ****************************************************************************
  755.  
  756. ;  
  757. ; *  New object system calls to query the object system.
  758. ; *
  759. ; *  These comments to move to the stubs file before final release, they 
  760. ; *  are here for documentation for developers using early seeds.
  761.  
  762. ; *  Given a class name as a string return the associated class type for the 
  763. ; *  class, may return kQ3Failure if the string representing the class is 
  764. ; *  invalid.
  765.  
  766. ;
  767. ; extern TQ3Status Q3ObjectHierarchy_GetTypeFromString(TQ3ObjectClassNameString objectClassString, TQ3ObjectType *objectClassType)
  768. ;
  769.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  770.         IMPORT_CFM_FUNCTION Q3ObjectHierarchy_GetTypeFromString
  771.     ENDIF
  772.  
  773. ; *  Given a class type as return the associated string for the class name, 
  774. ; *  may return kQ3Failure if the type representing the class is invalid.
  775.  
  776. ;
  777. ; extern TQ3Status Q3ObjectHierarchy_GetStringFromType(TQ3ObjectType objectClassType, TQ3ObjectClassNameString objectClassString)
  778. ;
  779.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  780.         IMPORT_CFM_FUNCTION Q3ObjectHierarchy_GetStringFromType
  781.     ENDIF
  782.  
  783. ;  
  784. ; *  Return true if the class with this type is registered, false if not 
  785.  
  786. ;
  787. ; extern TQ3Boolean Q3ObjectHierarchy_IsTypeRegistered(TQ3ObjectType objectClassType)
  788. ;
  789.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  790.         IMPORT_CFM_FUNCTION Q3ObjectHierarchy_IsTypeRegistered
  791.     ENDIF
  792.  
  793. ;  
  794. ; *  Return true if the class with this name is registered, false if not 
  795.  
  796. ;
  797. ; extern TQ3Boolean Q3ObjectHierarchy_IsNameRegistered(const char *objectClassName)
  798. ;
  799.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  800.         IMPORT_CFM_FUNCTION Q3ObjectHierarchy_IsNameRegistered
  801.     ENDIF
  802.  
  803. ; * TQ3SubClassData is used when querying the object system for
  804. ; * the subclasses of a particular parent type:
  805.  
  806. TQ3SubClassData            RECORD 0
  807. numClasses                 ds.l    1                ; offset: $0 (0)        ;  the # of subclass types found for a parent class 
  808. classTypes                 ds.l    1                ; offset: $4 (4)        ;  an array containing the class types 
  809. sizeof                     EQU *                    ; size:   $8 (8)
  810.                         ENDR
  811. ; *  Given a parent type and an instance of the TQ3SubClassData struct fill
  812. ; *  it in with the number and class types of all of the subclasses immediately
  813. ; *  below the parent in the class hierarchy.  Return kQ3Success to indicate no
  814. ; *  errors occurred, else kQ3Failure.
  815. ; *
  816. ; *  NOTE:  This function will allocate memory for the classTypes array.  Be 
  817. ; *    sure to call Q3ObjectClass_EmptySubClassData to free this memory up.
  818.  
  819. ;
  820. ; extern TQ3Status Q3ObjectHierarchy_GetSubClassData(TQ3ObjectType objectClassType, TQ3SubClassData *subClassData)
  821. ;
  822.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  823.         IMPORT_CFM_FUNCTION Q3ObjectHierarchy_GetSubClassData
  824.     ENDIF
  825.  
  826. ; *  Given an instance of the TQ3SubClassData struct free all memory allocated 
  827. ; *    by the Q3ObjectClass_GetSubClassData call.
  828. ; *
  829. ; *  NOTE: This call MUST be made after a call to Q3ObjectClass_GetSubClassData
  830. ; *  to avoid memory leaks.
  831.  
  832. ;
  833. ; extern TQ3Status Q3ObjectHierarchy_EmptySubClassData(TQ3SubClassData *subClassData)
  834. ;
  835.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  836.         IMPORT_CFM_FUNCTION Q3ObjectHierarchy_EmptySubClassData
  837.     ENDIF
  838.  
  839.  
  840. ; ******************************************************************************
  841. ; **                                                                             **
  842. ; **                                Object Routines                                 **
  843. ; **                                                                             **
  844. ; ****************************************************************************
  845.  
  846. ;
  847. ; extern TQ3Status Q3Object_Dispose(TQ3Object object)
  848. ;
  849.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  850.         IMPORT_CFM_FUNCTION Q3Object_Dispose
  851.     ENDIF
  852.  
  853. ;
  854. ; extern TQ3Object Q3Object_Duplicate(TQ3Object object)
  855. ;
  856.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  857.         IMPORT_CFM_FUNCTION Q3Object_Duplicate
  858.     ENDIF
  859.  
  860. ;
  861. ; extern TQ3Status Q3Object_Submit(TQ3Object object, TQ3ViewObject view)
  862. ;
  863.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  864.         IMPORT_CFM_FUNCTION Q3Object_Submit
  865.     ENDIF
  866.  
  867. ;
  868. ; extern TQ3Boolean Q3Object_IsDrawable(TQ3Object object)
  869. ;
  870.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  871.         IMPORT_CFM_FUNCTION Q3Object_IsDrawable
  872.     ENDIF
  873.  
  874. ;
  875. ; extern TQ3Boolean Q3Object_IsWritable(TQ3Object object, TQ3FileObject theFile)
  876. ;
  877.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  878.         IMPORT_CFM_FUNCTION Q3Object_IsWritable
  879.     ENDIF
  880.  
  881.  
  882. ; ******************************************************************************
  883. ; **                                                                             **
  884. ; **                            Object Type Routines                             **
  885. ; **                                                                             **
  886. ; ****************************************************************************
  887.  
  888. ;
  889. ; extern TQ3ObjectType Q3Object_GetType(TQ3Object object)
  890. ;
  891.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  892.         IMPORT_CFM_FUNCTION Q3Object_GetType
  893.     ENDIF
  894.  
  895. ;
  896. ; extern TQ3ObjectType Q3Object_GetLeafType(TQ3Object object)
  897. ;
  898.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  899.         IMPORT_CFM_FUNCTION Q3Object_GetLeafType
  900.     ENDIF
  901.  
  902. ;
  903. ; extern TQ3Boolean Q3Object_IsType(TQ3Object object, TQ3ObjectType theType)
  904. ;
  905.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  906.         IMPORT_CFM_FUNCTION Q3Object_IsType
  907.     ENDIF
  908.  
  909.  
  910. ; ******************************************************************************
  911. ; **                                                                             **
  912. ; **                            Shared Object Routines                             **
  913. ; **                                                                             **
  914. ; ****************************************************************************
  915.  
  916. ;
  917. ; extern TQ3ObjectType Q3Shared_GetType(TQ3SharedObject sharedObject)
  918. ;
  919.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  920.         IMPORT_CFM_FUNCTION Q3Shared_GetType
  921.     ENDIF
  922.  
  923. ;
  924. ; extern TQ3SharedObject Q3Shared_GetReference(TQ3SharedObject sharedObject)
  925. ;
  926.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  927.         IMPORT_CFM_FUNCTION Q3Shared_GetReference
  928.     ENDIF
  929.  
  930. ;  
  931. ; *    Q3Shared_IsReferenced
  932. ; *        Returns kQ3True if there is more than one reference to sharedObject.
  933. ; *        Returns kQ3False if there is ONE reference to sharedObject.
  934. ; *    
  935. ; *    This call is intended to allow applications and plug-in objects to delete
  936. ; *    objects of which they hold THE ONLY REFERENCE. This is useful when
  937. ; *    caching objects, etc.
  938. ; *    
  939. ; *    Although many may be tempted, DO NOT DO THIS:
  940. ; *        while (Q3Shared_IsReferenced(foo)) { Q3Object_Dispose(foo); }
  941. ; *    
  942. ; *    Your application will crash and no one will buy it. Chapter 11 is 
  943. ; *    never fun (unless you short the stock). Thanks.
  944.  
  945. ;
  946. ; extern TQ3Boolean Q3Shared_IsReferenced(TQ3SharedObject sharedObject)
  947. ;
  948.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  949.         IMPORT_CFM_FUNCTION Q3Shared_IsReferenced
  950.     ENDIF
  951.  
  952. ; *    Q3Shared_GetEditIndex
  953. ; *        Returns the "serial number" of sharedObject. Usefuly for caching 
  954. ; *        object information. Returns 0 on error.
  955. ; *        
  956. ; *        Hold onto this number to determine if an object has changed since you
  957. ; *        last built your caches... To validate, do:
  958. ; *        
  959. ; *        if (Q3Shared_GetEditIndex(foo) == oldFooEditIndex) {
  960. ; *            // Cache is valid
  961. ; *        } else {
  962. ; *            // Cache is invalid
  963. ; *            RebuildSomeSortOfCache(foo);
  964. ; *            oldFooEditIndex = Q3Shared_GetEditIndex(foo);
  965. ; *        }
  966.  
  967. ;
  968. ; extern unsigned long Q3Shared_GetEditIndex(TQ3SharedObject sharedObject)
  969. ;
  970.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  971.         IMPORT_CFM_FUNCTION Q3Shared_GetEditIndex
  972.     ENDIF
  973.  
  974. ; *    Q3Shared_Edited
  975. ; *        Bumps the "serial number" of sharedObject to a different value. This
  976. ; *        call is intended to be used solely from a plug-in object which is 
  977. ; *        shared. Call this whenever your private instance data changes.
  978. ; *        
  979. ; *        Returns kQ3Failure iff sharedObject is not a shared object, OR
  980. ; *            QuickDraw 3D isn't initialized.
  981.  
  982. ;
  983. ; extern TQ3Status Q3Shared_Edited(TQ3SharedObject sharedObject)
  984. ;
  985.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  986.         IMPORT_CFM_FUNCTION Q3Shared_Edited
  987.     ENDIF
  988.  
  989.  
  990. ; ******************************************************************************
  991. ; **                                                                             **
  992. ; **                                Shape Routines                                 **
  993. ; **                                                                             **
  994. ; ****************************************************************************
  995.  
  996. ; *    QuickDraw 3D 1.5 Note:
  997. ; *
  998. ; *    Shapes and Sets are now (sort of) polymorphic.
  999. ; *
  1000. ; *        You may call Q3Shape_Foo or Q3Set_Foo on a shape or a set.
  1001. ; *        The following calls are identical, in implementation:
  1002. ; *
  1003. ; *            Q3Shape_GetElement            =    Q3Set_Get
  1004. ; *            Q3Shape_AddElement            =    Q3Set_Add
  1005. ; *            Q3Shape_ContainsElement        =    Q3Set_Contains
  1006. ; *            Q3Shape_GetNextElementType    =    Q3Set_GetNextElementType
  1007. ; *            Q3Shape_EmptyElements        =    Q3Set_Empty
  1008. ; *            Q3Shape_ClearElement        =    Q3Set_Clear
  1009. ; *
  1010. ; *    All of these calls accept a shape or a set as their first parameter.
  1011. ; *
  1012. ; *    The Q3Shape_GetSet and Q3ShapeSetSet calls are implemented via a new
  1013. ; *    element type kQ3ElementTypeSet. See the note above about 
  1014. ; *    kQ3ElementTypeSet;
  1015. ; *
  1016. ; *    It is important to note that the new Q3Shape_...Element... calls do not
  1017. ; *    create a set on a shape and then add the element to it. This data is
  1018. ; *    attached directly to the shape. Therefore, it is possible for an element
  1019. ; *    to exist on a shape without a set existing on it as well. 
  1020. ; *
  1021. ; *    In your application, if you attach an element to a shape like this:
  1022. ; *        (this isn't checking for errors for simplicity)
  1023. ; *
  1024. ; *        set = Q3Set_New();
  1025. ; *        Q3Set_AddElement(set, kMyElemType, &data);
  1026. ; *        Q3Shape_SetSet(shape, set);
  1027. ; *
  1028. ; *    You should retrieve it in the same manner:
  1029. ; *
  1030. ; *        Q3Shape_GetSet(shape, &set);
  1031. ; *        if (Q3Set_Contains(set, kMyElemType) == kTrue) {
  1032. ; *            Q3Set_Get(set, kMyElemType, &data);
  1033. ; *        }
  1034. ; *
  1035. ; *    Similarly, if you attach data to a shape with the new calls:
  1036. ; *
  1037. ; *        Q3Shape_AddElement(shape, kMyElemType, &data);
  1038. ; *
  1039. ; *    You should retrieve it in the same manner:
  1040. ; *
  1041. ; *        if (Q3Shape_ContainsElement(set, kMyElemType) == kTrue) {
  1042. ; *            Q3Shape_GetElement(set, kMyElemType, &data);
  1043. ; *        }
  1044. ; *
  1045. ; *    This really becomes an issue when dealing with version 1.0 and version 1.1 
  1046. ; *    metafiles.
  1047. ; *
  1048. ; *    When attempting to find a particular element on a shape, you should
  1049. ; *    first check with Q3Shape_GetNextElementType or Q3Shape_GetElement, then,
  1050. ; *    Q3Shape_GetSet(s, &set) (or Q3Shape_GetElement(s, kQ3ElementTypeSet, &set))
  1051. ; *    and then Q3Shape_GetElement(set, ...).
  1052. ; *
  1053. ; *    In terms of implementation, Q3Shape_SetSet and Q3Shape_GetSet should only be
  1054. ; *    used for sets of information that are shared among multiple shapes.
  1055. ; *    
  1056. ; *    Q3Shape_AddElement, Q3Shape_GetElement, etc. calls should only be used
  1057. ; *    for elements that are unique for a particular shape.
  1058. ; *    
  1059.  
  1060. ;
  1061. ; extern TQ3ObjectType Q3Shape_GetType(TQ3ShapeObject shape)
  1062. ;
  1063.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1064.         IMPORT_CFM_FUNCTION Q3Shape_GetType
  1065.     ENDIF
  1066.  
  1067. ;
  1068. ; extern TQ3Status Q3Shape_GetSet(TQ3ShapeObject shape, TQ3SetObject *theSet)
  1069. ;
  1070.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1071.         IMPORT_CFM_FUNCTION Q3Shape_GetSet
  1072.     ENDIF
  1073.  
  1074. ;
  1075. ; extern TQ3Status Q3Shape_SetSet(TQ3ShapeObject shape, TQ3SetObject theSet)
  1076. ;
  1077.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1078.         IMPORT_CFM_FUNCTION Q3Shape_SetSet
  1079.     ENDIF
  1080.  
  1081. ;
  1082. ; extern TQ3Status Q3Shape_AddElement(TQ3ShapeObject shape, TQ3ElementType theType, const void *data)
  1083. ;
  1084.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1085.         IMPORT_CFM_FUNCTION Q3Shape_AddElement
  1086.     ENDIF
  1087.  
  1088. ;
  1089. ; extern TQ3Status Q3Shape_GetElement(TQ3ShapeObject shape, TQ3ElementType theType, void *data)
  1090. ;
  1091.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1092.         IMPORT_CFM_FUNCTION Q3Shape_GetElement
  1093.     ENDIF
  1094.  
  1095. ;
  1096. ; extern TQ3Boolean Q3Shape_ContainsElement(TQ3ShapeObject shape, TQ3ElementType theType)
  1097. ;
  1098.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1099.         IMPORT_CFM_FUNCTION Q3Shape_ContainsElement
  1100.     ENDIF
  1101.  
  1102. ;
  1103. ; extern TQ3Status Q3Shape_GetNextElementType(TQ3ShapeObject shape, TQ3ElementType *theType)
  1104. ;
  1105.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1106.         IMPORT_CFM_FUNCTION Q3Shape_GetNextElementType
  1107.     ENDIF
  1108.  
  1109. ;
  1110. ; extern TQ3Status Q3Shape_EmptyElements(TQ3ShapeObject shape)
  1111. ;
  1112.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1113.         IMPORT_CFM_FUNCTION Q3Shape_EmptyElements
  1114.     ENDIF
  1115.  
  1116. ;
  1117. ; extern TQ3Status Q3Shape_ClearElement(TQ3ShapeObject shape, TQ3ElementType theType)
  1118. ;
  1119.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1120.         IMPORT_CFM_FUNCTION Q3Shape_ClearElement
  1121.     ENDIF
  1122.  
  1123.  
  1124. ; ******************************************************************************
  1125. ; **                                                                             **
  1126. ; **                            Color Table Routines                             **
  1127. ; **                                                                             **
  1128. ; ****************************************************************************
  1129.  
  1130. ;
  1131. ; extern TQ3Status Q3Bitmap_Empty(TQ3Bitmap *bitmap)
  1132. ;
  1133.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1134.         IMPORT_CFM_FUNCTION Q3Bitmap_Empty
  1135.     ENDIF
  1136.  
  1137. ;
  1138. ; extern unsigned long Q3Bitmap_GetImageSize(unsigned long width, unsigned long height)
  1139. ;
  1140.     IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  1141.         IMPORT_CFM_FUNCTION Q3Bitmap_GetImageSize
  1142.     ENDIF
  1143.  
  1144.  
  1145.  
  1146.     ENDIF ; __QD3D__ 
  1147.  
  1148.